#pragma once

#include "fxcc/core/Base.h"
#include "fxcc/core/graph/common/GeometryData.h"
#include "fxcc/core/graph/common/SkinnedMeshData.h"
#include "fxcc/core/graph/common/MSDF.h"

namespace fxcc
{
    namespace graph
    {
        namespace common
        {
            struct FXCC_API MeshOffset
            {
                int m_StartSlot{ 0 };

                int m_NumSlot{ 0 };

            };
            struct FXCC_API  MeshJack :public fxcc::Base
            {
                struct Desc
                {
                    fxcc::graph::common::GeometryData m_GeoData;
                    fxcc::graph::common::SkinnedMeshData m_SkinnedMeshData;
                    fxcc::graph::common::MSDFGeoData m_MSDFGeoData;

                    void Clear()
                    {
                        m_GeoData.Clear();
                        m_SkinnedMeshData.Clear();
                        m_MSDFGeoData.Clear();
                    }
                    Desc(const fxcc::graph::common::MSDFGeoData& msdfGeoData) :m_MSDFGeoData(msdfGeoData)
                    {

                    }
              
                    Desc(const fxcc::graph::common::GeometryData geoData) :m_GeoData(geoData)
                    {

                    }

                    Desc(const fxcc::graph::common::GeometryData geoData, const fxcc::graph::common::SkinnedMeshData& skinnedData) :m_GeoData(geoData), m_SkinnedMeshData(skinnedData)
                    {

                    }
                    bool HasFixedData() const
                    {
                        return (m_GeoData.indices32.size() > 0) && (m_GeoData.vertices.size() > 0);
                    }
                    bool HasSkinnedData()const
                    {
                        return m_SkinnedMeshData.bones1s.size();
                    }
                } m_Desc;

                fxcc::graph::common::VertexType m_VertexType{ fxcc::graph::common::VertexType::_vertex_fixed_ };

                fxcc::graph::common::IndexType m_IndexType{ fxcc::graph::common::IndexType::_index_unsigned_int_ };

                fxcc::graph::common::ModeType m_ModeType{ fxcc::graph::common::ModeType::_mode_Triangles_ };

                int m_NumVertices{ 0 };

                int m_NumIndices{ 0 };

                MeshJack(const Desc& desc) :m_Desc(desc)
                {

                }

                virtual void Bind() const {
                    assert(0 && "CommonMesh Bind");
                }

                virtual void DrawElementsAuto() const {
                    assert(0 && "CommonMesh DrawElements");

                };
            };
        }
    }
};

